package com.example.tool.listener;

/**
 *
 * 自定义异常类
 */

public class ADException extends AGException {

    protected int errorCode;//错误码
    protected String description;//错误信息提示

    public ADException(int errorCode) {
        super(errorCode);
    }

    public ADException(int errorCode, String detailMessage) {
        super(errorCode, detailMessage);
    }

    public ADException(int errorCode, String detailMessage, String description) {
        super(errorCode, detailMessage, description);
    }

    public ADException(int errorCode, Throwable throwable) {
        super(errorCode, throwable);
    }

//    public ADException(int errorCode) {
//        this.errorCode = errorCode;
//    }
//
//    public ADException(int errorCode, String detailMessage) {
//        super(detailMessage);
//        this.errorCode = errorCode;
//    }
//
//    public ADException(int errorCode, String detailMessage, String description) {
//        super(detailMessage);
//        this.errorCode = errorCode;
//        this.description = description;
//    }
//
//    public ADException(int errorCode, Throwable throwable) {
//        super(throwable);
//        this.errorCode = errorCode;
//    }

    public int getErrorCode() {
        return this.errorCode;
    }

    public String getDescription() {
        return this.description;
    }

    @Override
    public String toString() {
        return "ADException{" +
                "errorCode=" + errorCode +
                ", description='" + description + '\'' +
                '}';
    }
}
